<template>
	<view class="fillmachineList">
		<view class="cu-bar search bg-white">
			<view class="search-form round">
				<text class="cuIcon-search"></text>
				<input @focus="InputFocus" @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入加注站或加注机名称" confirm-type="search"></input>
			</view>
		</view>
		<radio-group @change="radioChange">
		<view class="cu-list menu padding-bottom-lg fillmachineListH">
			
				<label class="cu-item" v-for="i in 10">
					<view class="content padding-tb-sm">
						<view>撮镇路口加注站{{i}}</view>
						<view class="text-gray">yz001</view>
					</view>
					<view class="action">
						<radio class='blue radio' :class="current===i?'checked':''" :checked="current===i?true:false" value="B"  style="transform:  scale(.7);"></radio>
					</view>
				</label>	
		</view>
		</radio-group>
		<view class="btn-common">
			<button class="cu-btn margin-bottom-xl block bg-blue" style="padding: 40rpx 0;" @click="confirmFillmachine">确认</button>
		</view>
		<!--温馨提醒-->
		<view class="cu-modal" :class="modalName=='tip'?'show':''">
			<view class="cu-dialog bg-white tip">
				<view class="cu-bar bg-white justify-end">
					<view class="content text-bold">温馨提示</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-black"></text>
					</view>
				</view>
				<view class="tip-content">
					<image src="../../static/image/tipIcon.png"></image>
					<text class="text-bold">还没选择加注机?</text>
				</view>
				<view class="flex justify-center padding-lg tip-btn">
					<button class="cu-btn bg-cancel margin-right-lg">关闭</button>
					<button class="cu-btn bg-blue">好的</button>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				current:null,
				modalName:null,
				form:null
			}
		},
		onShow() {
			this.getQuery()
		},
		methods:{
			getQuery(){
				this.from=this.$mp.query.from
				console.log(query)
			},
			hideModal(){
				this.modalName=null
			},
			radioChange(e){
				console.log(e)
				this.current=e.detail.value
			},
			confirmFillmachine(){
				if(!this.current){
					this.modalName='tip' 
					return
				} 
				uni.navigateTo({
					url:'/pages/user/question'
				})
			}
		}
		
	}
</script>

<style lang="scss">
	page{
		background-color: white;
	}
	.fillmachineList{
		radio-group{
			display:block;
		}
	}
	.fillmachineListH{
		height: calc(100vh - 350rpx);
		overflow-y: scroll;
	}
	
</style>